﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace devtm.Editor.Configuration.Customs
{

    public class CustomLabel : INotifyPropertyChanged
    {


        #region Properties


        private string _text;
        public string Text
        {
            get
            {
                return _text;
            }
            set
            {
                if (_text == value)
                    return;
                _text = value;

                PropertyChange("Text");
            }
        }


        private string _culture;
        [System.Xml.Serialization.XmlAttribute()]
        public string Culture
        {
            get
            {
                return _culture;
            }
            set
            {
                if (_culture == value)
                    return;
                _culture = value;

                PropertyChange("Culture");
            }
        }


        private DateTime _LastUpdate;
        [System.Xml.Serialization.XmlAttribute()]
        public DateTime LastUpdate
        {
            get
            {
                return _LastUpdate;
            }
            set
            {
                if (_LastUpdate == value)
                    return;
                _LastUpdate = value;

                PropertyChange("LastUpdate");
            }
        }


        #endregion


        #region Change

        private void PropertyChange(string p)
        {

            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(p));

            if (p != "LastUpdate")
                LastUpdate = DateTime.Now;

        }

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

    }
}
